using Common.Commands.AccountCommands;
using Common.Enumerations;
using Core.Domain.Model;
using NUnit.Framework;
using Sanelib.Common.Extensions;
using Sanelib.Common.Helpers;
using WebApp.ModelService;

namespace IntegrationTests.ModelServices
{
    public class AttachmentModelServiceTester : IntegrationTestBase
    {
        [Test]
        public void ShouldTestGetDetailById()
        {
            var member = GetSiteUser();

            var account = new Account
            {
                Id = GuidComb.New(),
                Name = "Priya",
                AccountType = AccountType.Vendor,
                AccountNumber = "accountnumber",
                Industry = Industry.InternetPublishing,
                BillingStreet = "billingstreet",
                BillingCity = "city",
                BillingState = "state",
                BillingPostalCode = "code",
                BillingCountry = "county",
                BillingLatitude = 0,
                BillingLongitude = 0,
                ShippingStreet = "sstreet",
                ShippingCity = "scity",
                ShippingState = "sstate",
                ShippingPostalCode = "Scode",
                ShippingCountry = "scountry",
                ShippingLatitude = 0,
                ShippingLongitude = 0,
                Phone = "phone",
                Mobile = "mobile",
                Fax = "fax",
                Website = "web",
                Email = "email@email.com",
                Description = "Description",
                ImageData = ImageUtility.NoImageData
            };           

            var attachment = new Attachment
            {
                Id = GuidComb.New(),
                Name = "SanelibAccounts",
                Tags = "hello",
                FileType = "image/png",
                FileSize = 10,
                FileHashCode = "gsdhf35989fsnl1324ywefnj",
                ImageData = ImageUtility.NoImageData,
                EntityType = EntityType.Account,
                ReferenceId = account.Id,
                ReferenceName = "AC",
                Description = "This file for Account of sanelib",                
            };

            var attachment1 = new Attachment
            {
                Id = GuidComb.New(),
                Name = "Sailfin",
                Tags = "sanelib",
                FileType = "image/png",
                FileSize = 10,
                FileHashCode = "gsdhf35989fsnl1324ywefnj",
                ImageData = ImageUtility.NoImageData,
                EntityType = EntityType.Account,
                ReferenceId = account.Id,
                ReferenceName = "AC",
                Description = "This file for Account of sanelib",                
            };


            var attachment2 = new Attachment
            {
                Id = GuidComb.New(),
                Name = "I-infotechsys",
                Tags = "hello",
                FileType = "image/png",
                FileSize = 10,
                FileHashCode = "gsdhf35989fsnl1324ywefnj",
                ImageData = ImageUtility.NoImageData,
                EntityType = EntityType.Account,
                ReferenceId = account.Id,
                ReferenceName = "AC",
                Description = "This file for Account of sanelib",
            };

            var attachment3 = new Attachment
            {
                Id = GuidComb.New(),
                Name = "Account",
                Tags = "hello, sanelib",
                FileType = "image/png",
                FileSize = 10,
                FileHashCode = "gsdhf35989fsnl1324ywefnj",
                ImageData = ImageUtility.NoImageData,
                EntityType = EntityType.Account,
                ReferenceId = account.Id,
                ReferenceName = "AC",
                Description = "This file for Account of sanelib",
            };

            Persist(member, account, attachment, attachment1, attachment2, attachment3);

            var accountModelService = GetInstance<IAttachmentModelService>();

            var response = accountModelService.GetAttachmentsBySearchValue("Sanelib");
        }
    }
}